import React from 'react';
import PropTypes from "prop-types";

class ItemPure extends React.PureComponent {
    static propTypes = {
        item: PropTypes.number,
        update: PropTypes.func,
    };

    acc = (e) => {
        this.props.update(this.props.item + 1);
    };

    render() {
        console.dir('pure item render');
        return (
            <li onClick={this.acc}>
                <button>{this.props.item}</button>
            </li>
        )
    }
}

export default ItemPure;
